﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Rvz.Game.Main.Entities.Robots.Upgrades;
using Rvz.Game.Main.Entities.Robots.Weapons;

namespace Rvz.Game.Main.Entities.Robots
{
    public class RobotAttributes
    {
        public RobotAttributes()
        {
            Upgrades = new Collection<IUpgrade>();
            AddUpgrade(new StartingGrade());
            CurrentWeapon = new StartingWeapon();
        }

        public int Health { get; set; }

        public int Armor { get; set; }
        public int ArmorDamageReduction { get; set; }

        public float MoveSpeed { get; set; }
        public int AllowedUpgrades { get; set; }
        public IWeapon CurrentWeapon { get; set; }

        public ICollection<IUpgrade> Upgrades { get; set; }

        public void AddUpgrade(IUpgrade upgrade)
        {
            upgrade.ApplyUpgrade(this);
            Upgrades.Add(upgrade);
        }

        public void RemoveUpgrade(IUpgrade upgrade)
        {
            upgrade.RemoveUpgrade(this);
            Upgrades.Remove(upgrade);
        }
    }
}
